/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package se.kth.lwr.jeat.utils;

import javax.measure.quantity.Quantity;
import se.kth.lwr.jeat.core.AmountDataSource;
import se.kth.lwr.jeat.core.AmountFunction;
import se.kth.lwr.jeat.core.DataSource;

/**<p>
 * The AmountConverter is responsible for converting Amounts of non-compatible
 * dimensions to compatible ones (in the current code context) and perform
 * this by use of {@link DataSource} objects rather than unwrapped values. 
 * The converted value is expressed by means of an {@link AmountFunction}. If 
 * certain conversion is not supported (or possible) the AmountConverter should 
 * throw an {@link IllegalArgumentException}.
 * </p>
 * <p>
 * The isSupported method should simply return true if and only if the argument 
 * is supported (are or can be converted to a compatible unit), false otherwise.
 * </p>
 *
 * @see ProductionSupport
 *
 * @author davidev
 */
public interface AmountConverter {
    
    /**
     * 
     * @param amount AmountDataSource to convert
     * @return the resulting AmountFunction
     * 
     */

    AmountFunction toCompatibleAmount(AmountDataSource<? extends Quantity> amount);
    
    /**Indicates if the passed AmountDataSourse are or
     * can be converted to a compatible amount
     * 
     * @param amount
     * @return true if it is possible, false otherwise
     */
    boolean isSupported(AmountDataSource amount);
    
}
